package es.index.logs.parse;

/**
 * 根据字符串获取月份
 * 
 * @author zhoujin
 */
public class GetMonthByString {
	private GetMonthByString() {
	}
	
	public static int month(String month) {
		month = month.trim();
		month = month.toLowerCase();
		if (month.equals("十二月") || month.equals("dec")) return 12;
		else if (month.equals("十一月") || month.equals("nov")) return 11;
		else if (month.equals("十月") || month.equals("oct")) return 10;
		else if (month.equals("九月") || month.equals("sep")) return 9;
		else if (month.equals("八月") || month.equals("aug")) return 8;
		else if (month.equals("七月") || month.equals("jul")) return 7;
		else if (month.equals("六月") || month.equals("jun")) return 6;
		else if (month.equals("五月") || month.equals("may")) return 5;
		else if (month.equals("四月") || month.equals("apr")) return 4;
		else if (month.equals("三月") || month.equals("mar")) return 3;
		else if (month.equals("二月") || month.equals("feb")) return 2;
		else if (month.equals("一月") || month.equals("jan")) return 1;
		return -1;
	}
}
